<?php
class Current_specials extends Controller
{
    function __construct()
    {
        parent::__construct();
         $this->load->helper(array('form','tiap_helper','html'));
        $this->load->library(array('form_validation','session'));
       $this->load->model('register_model');
    }    
    
    function index()
    {
       
       
        $this->load->view(TEMPLATE_NAME.'/front/current_specials_view',$data);
    }   
    
    function subscriber()
    {
       
        //$this->load->helper(array('form','url'));
        $this->load->library(array('form_validation','email','recaptcha'));
		
        $data = array();
		$this->form_validation->set_error_delimiters('<div class="error">','</div>');  			
					
		$this->form_validation->set_rules('emailId','e-mail','required|trim|xss_clean|valid_email');			
		
		
		//$this->validation->set_fields($fields);
		
		$this->form_validation->set_message('required', 'Please enter %s');
		
		$this->form_validation->set_message('valid_email', 'Please enter a valid %s address');
		
		if ($this->form_validation->run() == TRUE)
		{
		      $data['query'] = $this->current_specials_model->checkSubscriber($this->input->post('emailId'),$this->input->post('status'));
              
        }
        else
        {
            $data['query'] = 'error';
        }
        
        $data['status'] = $this->input->post('status');
        $this->load->view(TEMPLATE_NAME."/front/current_specials_subscriber_view",$data);
        
    } 
}
?>